import { createStore } from 'vuex'
const store = createStore({
	state() {
		return {
			count: 5
		}
	},
	getters: {
		doubleCount(state){
			return state.count * 2
		}
	},
	mutations: {
		increcement(state, data){
			state.count = data
		}
	},
	actions: {
		getCountAsync(context, data){
			setTimeout(() => {
				context.commit('increcement', data)
			}, 3000);
		}
	},
})
export default store